package com.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pojo.SysRole;
import com.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class RoleController {

    @Autowired
    RoleService roleService;
    /**
     * 角色管理跳转
     */
    @GetMapping("/crm/role/list")
    public Object roleList(@RequestParam(defaultValue = "1")Integer pageIndex,
                           @RequestParam(defaultValue = "2")Integer pageSize,
                           Model model){
        Page<SysRole> page = new Page<SysRole>(pageIndex,pageSize);
        model.addAttribute("rolePage",roleService.page(page));
//        model.addAttribute("content",roleService.list());
        return "role/list";
    }
}
